<?php
/**
* Django's templating engine (partial) PHP implementation.
* provides some template tags support
* @link http://djangoproject.com
* this file is from a webappkit package (kit)
* @link http://webappkit.net
* @package djtpl
* @author J.Ducastel <jeremie@ducastel.name>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

/**
* 'extends' tag node.
* <code>{% extends "parent" %}</code>
*/
class DjTplTagNode_extends extends DjTplTagNode {

	/**
	 * @var string parent's template id/name
	 */
	var $parent;

	/**
	* builds itself from tokens
	* @param djangoTplToken &$selfToken
	* @access public
	* @return bool
	*/
	function buildFromTokens(&$selfToken) {
		$def=$selfToken->tagdef;
		$regex='"([a-zA-Z0-9\._-]+)"';
		if (ereg($regex,$def,$search)) {
			$this->parent=$search[1];
		} else {
			// error !
			trigger_error('invalid structure for tag extends : '.$def);
		}
		return true;
	}

	/**
	* is the node atomic (has no children)
	* @access public
	* @return bool
	*/
	function isAtomic() {
		return true;
	}/**/

	/**
	* renders as string
	* @access public
	* @return string
	*/
	function render() {
		return '';
		// return '<p>extends '.$this->parent.'</p>';
	}/**/
}
